	<layout name="newlayout" />
	<div id="main-content"> <!-- Main Content Section with everything -->
			<!-- Page Head -->
			<div class="content-box"  ><!-- Start Content Box -->
				<div class="content-box-header">
					<h3>广告管理>新增图片
					</h3>
					<div class="clear"></div>
				</div> <!-- End .content-box-header -->
				<div class="content-box-content">
					<div>
					<div class="notification attention png_bg"  >
							<a href="#" class="close"><img src="__IMG__cross_grey_small.png" title="Close this notification" alt="close" /></a>
							<div >
								提示：<span class="star">&nbsp;&nbsp;*&nbsp;&nbsp;</span>为必填，其他选填！！
							</div>
						</div>
						<form action="/admin/adver/index" method="post" id="article_add" >
							<fieldset> <!-- Set class to "column-left" or "column-right" on fieldsets to divide the form into columns -->
								<p>
										标题：<span class="star">*</span>&nbsp;<input class="text-input small-input not_null" type="text"  name="title" /> <span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<p>
										标题：<span class="star">*</span>&nbsp;
										<SELECT name="a_id">
										<?php foreach ($list as $r){?>
										<OPTION value="<?=$r['id'] ?>"><?=$r['title'] ?></OPTION>
										<?php }?>
										</SELECT>
										<span class="input-notification success png_bg">Successful message</span> <!-- Classes for input-notification: success, error, information, attention -->
								</p>
								<p>
									url：<input class="text-input medium-input" type="text"  name="url"  /> <span class="input-notification  png_bg"></span>
								</p>
								<p>
									图片：<input class="text-input small-input" type="text"  name="img" id="adver_img" /><a href="javascript:" onclick="myModalShow()" class="button"> 上传</a> <span class="input-notification  png_bg"></span>
								</p>
								<p>
									<input class="button" type="button" value="保存"  id="tijiao" onclick="model_save();" />
								</p>
							</fieldset>
							<div class="clear"></div>
						</form>
							</div>
				</div>		
					</div>   
				</div> 
			</div> 
		</div> 
		<include file="./Application/Admin/View/upload_img.php" />
<script>
function uploadImgFunction(data){
	$("#adver_img").val(data);
}
//提交表单
$(function(){
						//表单检查是否为空
						$(".not_null").blur(function(){
							var obj=$(this).find("+span");
								 if($(this).val()==""){
									 obj.removeClass("success");
									 obj.addClass("error");
									 obj.html("不能为空！");
									 $("#tijiao").attr("disabled","disabled"); 
								 } else{
									 obj.removeClass("error");
									 obj.addClass("success");
									 $("#tijiao").removeAttr("disabled"); 
								 }
						});
	
});

	  function model_save(){
	      $("#article_add").submit();
	    }

</script>
